package com.roadmap.client.auth;

import com.roadmap.entities.Aspirant;
import com.roadmap.exception.EntityNotFoundException;
import com.roadmap.exception.InvalidActionException;
import com.roadmap.exception.InvalidValueException;
import com.roadmap.exception.LogonException;
import com.roadmap.exception.NotMatchedException;
import com.roadmap.exception.NotRegisteredException;
import com.roadmap.exception.NullObjectException;
import com.roadmap.exception.ServerException;

public interface IAuthServices {
	/**
	 * log on user by mail and password. user's id will be returned if user
	 * successfully log on
	 */
	public Aspirant logon(String mail, String password, String ipAddr)
			throws InvalidActionException, ServerException,
			NullObjectException, InvalidValueException, LogonException;

	/** reset user's password. 
	 * @throws NotMatchedException */
	public void resetPassword(String aspirantId, String oldPassword,
			String newPassword) throws NullObjectException, ServerException,
			InvalidValueException, InvalidActionException,
			EntityNotFoundException, NotMatchedException;

	/**
	 * if user forget its password, it can get a temporary password for logging
	 * on. 
	 */
	public String getTempPassword(String mail, String ip)
			throws NullObjectException, ServerException, InvalidValueException,
			InvalidActionException, NotRegisteredException;
}
